package com.budwk.app.util.poiUtils.fireHiddenExcel.impl;

import cn.hutool.core.bean.BeanUtil;
import com.budwk.app.sqfw.dto.FireHiddenExcelParamSQDTO;
import com.budwk.app.sqfw.dto.FireHiddenExcelParamYuHongSQDTO;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.util.poiUtils.YuHongMenStreetFireHiddenExcelUtils;
import com.budwk.app.util.poiUtils.fireHiddenExcel.IFireHiddenExcel;

/**
 * @author ywm
 * @project wk-mini
 * @description 宇虹
 * @date 2023/11/29 16:51:18
 */
public class YuHongFireHiddenExcel implements IFireHiddenExcel {

    @Override
    public String createExcel(FireHiddenExcelParamSQDTO excelParamSQDTO, String isTemplate) {
        FireHiddenExcelParamYuHongSQDTO dto = new FireHiddenExcelParamYuHongSQDTO();
        BeanUtil.copyProperties(excelParamSQDTO, dto);
        //zhangp 2024-01-05 当是web模板下载时不需要查询用户信息
        if (!"isTemplate-web".equals(isTemplate)) {
            Sys_user createFileUser = sysUserService.fetch(excelParamSQDTO.getUserId());

            dto.setCreateUserName(createFileUser.getUsername());
            dto.setCreateUserPhone(createFileUser.getLoginname());
            dto.setCounty(createFileUser.getCounty());
            dto.setCommunity(createFileUser.getCommunity());
        }
        return YuHongMenStreetFireHiddenExcelUtils.createExcelSQ(dto, isTemplate);
    }

    @Override
    public String createExcel(FireHiddenExcelParamSQDTO excelParamSQDTO) {
        return null;
    }

    @Override
    public String downExcelTemplate(FireHiddenExcelParamSQDTO excelParamSQDTO) {
        return null;
    }
}
